package zzx;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class StudentLineUP {
    public static void main(String[] args){
        Scanner s=new Scanner(System.in);
        int n,m,b,l,d;
        n=s.nextInt();
        m=s.nextInt();
        List<Integer> students=new ArrayList<Integer>(n);
        for (int i=0;i<n;i++){
            students.add(i+1);
        }
        while (m>0){
        b=s.nextInt();
        l=s.nextInt();
        d=students.indexOf(b);
        students.remove(d);
        students.add(d+l,b);
        m--;
        }
        for (int i = 0; i < n; i++) {
            System.out.print(students.get(i)+" ");
        }
    }
}
